<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>运城市安全生产隐患排查治理信息系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath%>/css/style.css" rel="stylesheet" type="text/css"/>
	<script src="<%=basePath%>/js/js.js" type="text/javascript"></script>
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/check_jquery.js"></script>
	<script type="text/javascript" src="<%=path%>/js/table_span.js"></script>
	<script type="text/javascript">
		function doSelect(obj1,obj2){
			if(document.getElementById('yh_'+obj1).checked){
				var tem = document.getElementById('yh_'+obj1).value;
				var temArry = tem.split(',');
				if(temArry[1]==1){//合格
					document.getElementById('zg_'+obj1).checked = false;
					document.getElementById('zg_'+obj2).checked = false;
					document.getElementById('zg_'+obj1).disabled = true;
					document.getElementById('zg_'+obj2).disabled = true;
				}else{
					document.getElementById('zg_'+obj2).checked = true;
					document.getElementById('zg_'+obj1).disabled = false;
					document.getElementById('zg_'+obj2).disabled = false;
				}
				document.getElementById('yh_'+obj2).checked=false;
			}else{
				document.getElementById('yh_'+obj2).checked=false;
				document.getElementById('zg_'+obj1).checked = false;
				document.getElementById('zg_'+obj2).checked = false;
				document.getElementById('zg_'+obj1).disabled = true;
				document.getElementById('zg_'+obj2).disabled = true;
			}
		}
		function doSelect1(obj1,obj2){
			if(document.getElementById(obj1).checked){
				document.getElementById(obj2).checked=false;
			}else{
				document.getElementById(obj2).checked=false;
			}
		}
		function doSave(){
		   	var ylist = document.getElementsByName('yhYes');
		    var nlist = document.getElementsByName('yhNo');

			var allSize = ylist.length;
			var selSize = 0;
			for(var i = 0; i < ylist.length; i ++){
				if(ylist[i].checked){
					selSize++;
				}
			}
			for(var i = 0; i < nlist.length; i ++){
				if(nlist[i].checked){
					selSize++;
				}
			}
  			if(selSize==0){
				alert('请选择自查结果！');
				return false;
			}
			document.form1.submit();
		}
	</script>
  </head>
  
 <body>
<div id="allbody" onload="_w_table_lefttitle_rowspan('#mytable','1','2');">
	<div class="head">
		<iframe src="<%=basePath%>/head.jsp" width="1160" height="218" scrolling="no" frameborder="0" ></iframe>
	</div>
	<div class="con">
		<div class="left">
			<div class="left_info">
				<iframe src="<%=basePath%>/left_info.jsp" width="244" height="250" id="iframeleft_top"  onLoad="iFrameHeight()"  scrolling="no" frameborder="0" ></iframe>
			</div>
			<div class="left_link">
				<iframe src="<%=basePath%>/zczb_left.jsp" width="244" height="200" id="iframeleft_link"  onLoad="iFrameHeight2()" scrolling="no" frameborder="0" ></iframe>
			</div>
		</div>
		<div class="right">
			<div class="right_map">
				<div style="float: left;"><a href="<%=basePath%>/corp/index.action">首页</a> &gt; <span><a href="<%=basePath%>/zczb/_index.action">自查自报</a></span>&gt; <span>隐患自查</span></div>
				<div class="map_btn">
			  		<input type="button" name="btntj" class="input_link" onclick="window.location.href='<%=basePath%>/zczb/xw_bgdList.action'" value="返 回"/>
				</div>
			</div>
			<div class="right_list">
				<form action="<%=basePath%>/zczb/xw_saveBgd.action" name="form1" method="post">
					<table border="0" cellpadding="0" cellspacing="0" align="center" class="infolist" id="mytable">
						<tr class="cz">
							<th width="5%">序号</th>
							<th width="15%">类型</th>
							<th width="60%">自查内容</th>
							<th width="10%">是否合格</th>
							<th width="10%" style="border-right:none">是否整改</th>
						</tr>
						<s:if test="%{objList.size>0}">
						  	<s:iterator id="obj" value="objList" status="x">
						  		<tr class="cz" id="bgd_${obj.id }">
									<td>${x.index+1}</td>
									<td>${obj.typeName }</td>
									<td align="left">${obj.bzhInfo }</td>
									<td>
										<s:if test="%{#obj.isCheck==0}">
											<input type="checkbox" name="yhYes"   id="yh_${obj.id }_1"  value="${obj.id },1" onclick="doSelect('${obj.id }_1','${obj.id }_2');">是&nbsp;&nbsp;
				    						<input type="checkbox" name="yhNo"   id="yh_${obj.id }_2"  value="${obj.id },2" onclick="doSelect('${obj.id }_2','${obj.id }_1');" checked="checked">否
										</s:if>
										<s:elseif test="#obj.isCheck==1">
											<input type="checkbox" name="yhYes"   id="yh_${obj.id }_1"  value="${obj.id },1" onclick="doSelect('${obj.id }_1','${obj.id }_2');" checked="checked">是&nbsp;&nbsp;
				    						<input type="checkbox" name="yhNo"   id="yh_${obj.id }_2"  value="${obj.id },2" onclick="doSelect('${obj.id }_2','${obj.id }_1');">否
										</s:elseif>
										<s:else>
											<input type="checkbox" name="yhYes"   id="yh_${obj.id }_1"  value="${obj.id },1" onclick="doSelect('${obj.id }_1','${obj.id }_2');">是&nbsp;&nbsp;
				    						<input type="checkbox" name="yhNo"   id="yh_${obj.id }_2"  value="${obj.id },2" onclick="doSelect('${obj.id }_2','${obj.id }_1');">否
										</s:else>
									</td>
									<td>
										<s:if test="%{#obj.isZg==0}">
											<input type="checkbox" name="zgYes"   id="zg_${obj.id }_1"  value="${obj.id },1" onclick="doSelect1('zg_${obj.id }_1','zg_${obj.id }_2');">是&nbsp;&nbsp;
				    						<input type="checkbox" name="zgNo"   id="zg_${obj.id }_2"  value="${obj.id },2" onclick="doSelect1('zg_${obj.id }_2','zg_${obj.id }_1');" checked="checked">否
										</s:if>
										<s:elseif test="#obj.isZg==1">
											<input type="checkbox" name="zgYes"   id="zg_${obj.id }_1"  value="${obj.id },1" onclick="doSelect1('zg_${obj.id }_1','zg_${obj.id }_2');" checked="checked">是&nbsp;&nbsp;
				    						<input type="checkbox" name="zgNo"   id="zg_${obj.id }_2"  value="${obj.id },2" onclick="doSelect1('zg_${obj.id }_2','zg_${obj.id }_1');">否
										</s:elseif>
										<s:else>
											<input type="checkbox" name="zgYes"   id="zg_${obj.id }_1"  value="${obj.id },1" onclick="doSelect1('zg_${obj.id }_1','zg_${obj.id }_2');" disabled="disabled">是&nbsp;&nbsp;
				    						<input type="checkbox" name="zgNo"   id="zg_${obj.id }_2"  value="${obj.id },2" onclick="doSelect1('zg_${obj.id }_2','zg_${obj.id }_1');" disabled="disabled">否
										</s:else>
									</td>
								</tr>
						  	</s:iterator>
						  	<tr>
								<td colspan="8" height="40" style="text-align:center">
								  	自查负责人：<input type="text" name="bgdPersonnel" id="bit1" value="${xwBgd.bgdPersonnel }"><label class="note4">*</label> 
									&nbsp;&nbsp;&nbsp;<input type="button" id="btnSubmit" name="btntj" class="input_link" value="保 存" onclick="return doSave();"/>
									<input type="hidden" name="bgdId" id="bgdId" value="${bgdId }">
									<input type="hidden" name="hzdId" id="hzdId" value="${hzdId }">
								</td>
							</tr>					  
						</s:if>
						<s:else>
						 	<tr>
								<td colspan="8" height="40" style="text-align:center">
								  	无自查标准，请联系管理部门。
								</td>
							</tr>
						</s:else>
					</table>
				</form>
			</div>
		</div>
	</div>
	<div class="foot">
		<iframe src="<%=basePath%>/foot.html" width="1160" height="89" scrolling="no" frameborder="0" ></iframe>
	</div>
</div>
<s:if test="%{tip!=null}">
	<script>
		alert('${tip}');
	</script>
</s:if>
</body>
</html>
